﻿#ifndef PARAMETERITEM_H
#define PARAMETERITEM_H

#include <QObject>

class ParameterItem : public QObject
{
    Q_OBJECT
    // ID
    Q_PROPERTY(int id READ id WRITE setId NOTIFY idChanged FINAL)
    // 名称
    Q_PROPERTY(QString Name READ Name WRITE setName NOTIFY NameChanged FINAL)
    // 编号
    Q_PROPERTY(QString Number READ Number WRITE setNumber NOTIFY NumberChanged FINAL)
    // 刀盘
    Q_PROPERTY(QString Knife READ Knife WRITE setKnife NOTIFY KnifeChanged FINAL)
    // 胶辊
    Q_PROPERTY(QString Roller READ Roller WRITE setRoller NOTIFY RollerChanged FINAL)
    // 压力1
    Q_PROPERTY(QString Stress01 READ Stress01 WRITE setStress01 NOTIFY Stress01Changed FINAL)
    // 压力2
    Q_PROPERTY(QString Stress02 READ Stress02 WRITE setStress02 NOTIFY Stress02Changed FINAL)
    // 压力3
    Q_PROPERTY(QString Stress03 READ Stress03 WRITE setStress03 NOTIFY Stress03Changed FINAL)
    // 前刀1
    Q_PROPERTY(QString F_Knife01 READ F_Knife01 WRITE setF_Knife01 NOTIFY F_Knife01Changed FINAL)
    // 前刀2
    Q_PROPERTY(QString F_Knife02 READ F_Knife02 WRITE setF_Knife02 NOTIFY F_Knife02Changed FINAL)
    // 前刀3
    Q_PROPERTY(QString F_Knife03 READ F_Knife03 WRITE setF_Knife03 NOTIFY F_Knife03Changed FINAL)
    // 后刀1
    Q_PROPERTY(QString B_Knife01 READ B_Knife01 WRITE setB_Knife01 NOTIFY B_Knife01Changed FINAL)
    // 后刀2
    Q_PROPERTY(QString B_Knife02 READ B_Knife02 WRITE setB_Knife02 NOTIFY B_Knife02Changed FINAL)
    // 后刀3
    Q_PROPERTY(QString B_Knife03 READ B_Knife03 WRITE setB_Knife03 NOTIFY B_Knife03Changed FINAL)

public:
    ParameterItem(QObject *parent = nullptr);

    // 清空数据
    void clear();

    // 复制数据
    void copyItem(ParameterItem* item);

    int id() const;
    void setId(int newId);

    QString Name() const;
    void setName(const QString &newName);

    QString Number() const;
    void setNumber(const QString &newNumber);

    QString Knife() const;
    void setKnife(const QString &newKnife);

    QString Roller() const;
    void setRoller(const QString &newRoller);

    QString Stress01() const;
    void setStress01(const QString &newStress01);

    QString Stress02() const;
    void setStress02(const QString &newStress02);

    QString Stress03() const;
    void setStress03(const QString &newStress03);

    QString F_Knife01() const;
    void setF_Knife01(const QString &newF_Knife01);

    QString F_Knife02() const;
    void setF_Knife02(const QString &newF_Knife02);

    QString F_Knife03() const;
    void setF_Knife03(const QString &newF_Knife03);

    QString B_Knife01() const;
    void setB_Knife01(const QString &newB_Knife01);

    QString B_Knife02() const;
    void setB_Knife02(const QString &newB_Knife02);

    QString B_Knife03() const;
    void setB_Knife03(const QString &newB_Knife03);

signals:
    void idChanged();
    void NameChanged();

    void NumberChanged();

    void KnifeChanged();

    void RollerChanged();

    void Stress01Changed();

    void Stress02Changed();

    void Stress03Changed();

    void F_Knife01Changed();

    void F_Knife02Changed();

    void F_Knife03Changed();

    void B_Knife01Changed();

    void B_Knife02Changed();

    void B_Knife03Changed();

private:
    int m_id;
    QString m_Name;
    QString m_Number;
    QString m_Knife;
    QString m_Roller;
    QString m_Stress01;
    QString m_Stress02;
    QString m_Stress03;
    QString m_F_Knife01;
    QString m_F_Knife02;
    QString m_F_Knife03;
    QString m_B_Knife01;
    QString m_B_Knife02;
    QString m_B_Knife03;
};

#endif // PARAMETERITEM_H
